
using Microsoft.AspNetCore.Mvc;
using Infrastructure.Filters;
using ZR.Infrastructure;
using ZR.Service.BaseFrame.IService;
using ZR.Model.BaseFrame.Dto;
using ZR.Model.BaseFrame.Entity;
using ZR.Model;
using ZR.Admin.WebApi.MainModules;
using ZR.ServiceCore.Attributes;

namespace ZR.Admin.WebApi.Controllers.BaseFrame
{
    /// <summary>
    /// 部门
    /// </summary>
    [Route("baseFrame/depart")]
    [ApiController]
    [EnableRspContract]
    [ModuleInfo(typeof(BaseFrameModule),"部门管理")]
    public class DepartController : DepartControllerBase
    {

            public DepartController(IDepartService departService, MapsterAdaptEntityCfg mapsterAdaptEntityCfg)
                :base(departService, mapsterAdaptEntityCfg)
            {

            }

            /// <summary>
            /// 查询组织树选择列表
            /// </summary>
            /// <param name="req"></param>
            /// <returns></returns>
            [HttpPost("orgTreeSelectList")]
            [ActionPermissionFilter(Permission = "depart:orgTreeSelectList")]
            public async Task<List<TreeNodeInfo>> GetOrgDepartTreeSelectList([FromBody] GetOrgDepartTreeSelectListReq req)
            {
                return await this._DepartService.GetOrgDepartTreeSelectList(req);
            }
    }
}